import request from '@/config/request'


export function getAddressDetail(params) {
    return request({
        url: '/user/getAddressById',
        method: 'post',
        params: params
    })
}

// 获取用户信息
export function getUserInfo() {
    return request({
        url: '/user/getUserSelfInfo',
        method: 'post'
    })
}


// 更新用户
export function updateUser(data) {
    return request({
        url: '/user/updateUserInfo',
        method: 'post',
        data: data
    })
}

// 更新用户角色
export function updateUserRole(params) {
    return request({
        url: '/user/updateUserRole',
        method: 'post',
        params: params
    })
}

// 获取用户地址列表
export function getAddresses() {
    return request({
        url: '/user/getAddresses',
        method: 'post'
    })
}

export function addAddress(data) {
    return request({
        url: '/user/createAddress',
        method: 'post',
        data: data
    })
}

export function EditAddress(data) {
    return request({
        url: '/user/updateAddress',
        method: 'post',
        data: data
    })
}

export function DeleteAddress(params) {
    return request({
        url: '/user/disableAddress',
        method: 'post',
        params: params
    })
}